package com.yuan.zsschool.ui.permission;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.yuan.base.framework.BaseFrameworkActivity;
import com.yuan.zsschool.AppContext;
import com.yuan.zsschool.R;
import com.yuan.zsschool.ui.account.ApplyTeachBindingActivity;
import com.yuan.zsschool.ui.teacherManage.TeacherManageActivity;

/**
 * 权限认证
 */
public class PermissionActivity extends BaseFrameworkActivity {

	private LinearLayout ll_do_sh;
	private LinearLayout ll_class_do_sh;
	private LinearLayout ll_teacher_manage;

	@Override
	protected int getLayoutId() {
		return R.layout.activity_permission;
	}

	@Override
	protected void bindViews() {
		ll_do_sh = findViewById(R.id.ll_do_sh);
		ll_class_do_sh = findViewById(R.id.ll_class_do_sh);
		ll_teacher_manage = findViewById(R.id.ll_teacher_manage);
		setOnClickListener(R.id.ll_do_sh, v -> startActivity(new Intent(this, PermissionDoSHActivity.class)));
		setOnClickListener(R.id.ll_apply, v -> startActivity(new Intent(this, ApplyTeachBindingActivity.class)));
		setOnClickListener(R.id.ll_class_do_sh, v -> startActivity(new Intent(this, PermissionClassDoSHActivity.class)));
		setOnClickListener(R.id.ll_teacher_manage, v -> startActivity(new Intent(this, TeacherManageActivity.class)));
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		if (AppContext.isMaster()) {
			ll_do_sh.setVisibility(View.VISIBLE);
			ll_class_do_sh.setVisibility(View.VISIBLE);
			ll_teacher_manage.setVisibility(View.VISIBLE);
		} else {
			ll_do_sh.setVisibility(View.GONE);
			ll_class_do_sh.setVisibility(View.GONE);
			ll_teacher_manage.setVisibility(View.GONE);
		}
	}

}
